package cn.may.controller;

import cn.may.utils.DownloadUtil;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.util.UUID;

/**
 * @author mayuanbao
 * @date 2019-06-08 11:49
 */
@RestController
public class DownloadController {
    @GetMapping("/download")
    public String download(HttpServletResponse response) throws Exception {
//        String path = ResourceUtils.getURL("classpath:").getPath() + "static/upload/student.xlsx";
        String path = "E:/ISO/cn_windows_10_business_editions_version_20h2_x64_dvd_f978664f.iso";
        return DownloadUtil.download(response, path);
    }
}
